home *** CD-ROM | disk | FTP | other *** search
- Path: news.cc.uic.edu!sunphy1!olczyk
- From: olczyk@sunphy1 (Constantin Rasinariu)
- Newsgroups: comp.lang.c++,comp.lang.pascal.delphi.misc
- Subject: Re: C++ with Zapp vs. Delphi
- Followup-To: comp.lang.c++,comp.lang.pascal.delphi.misc
- Date: 22 Jan 1996 02:09:06 GMT
- Organization: University of Illinois at Chicago
- Message-ID: <4durk2$2r54@tigger.cc.uic.edu>
- References: <4coar6$d4n@sun4.bham.ac.uk> <4coip7$69s@news1.usa.pipeline.com> <DBk8wg2yqjbB083yn@iaccess.za> <4d7pmb$48c8@tigger.cc.uic.edu> <4dk38h$gdr@merlin.delphi.com> <4dksp1$3d6c@tigger.cc.uic.edu> <30fe666e.3349285@130.15.126.54>
- NNTP-Posting-Host: sunphy1.phy.uic.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- Duncan Murdoch (dmurdoch@mast.queensu.ca) wrote:
- : The way this is done in Delphi is to create a descendant of the
- : SortedList that overrides the compare method. Instead of forcing you
- : to only put SortedObjects in the list, this allows you to put anything
- : there, even non-objects like integers or strings or empty holes, if
- : that suits your fancy.
-
- : There's not a big difference, but I think this is a little bit
- : preferable. It makes it clear that it's up to the list to know about
- : sorting, not up to the object. That way you can easily put the same
- : object in multiple lists with different sorting rules.
- Try
- class A:SortedObject (CompareTo not overridden)
- class B: A ( override with first comparison )
- class C: A (override second comparison )
- Of course with templates A doesn't have to derive from SortedObject.
- It's more type safe that way.
-
- OK. Try this one.
- You have a class, call it model which contains data and a list
- of objects that derive from a 'view' class. Each 'view' class must
- derive from a component. Each view class must received new data as it is
- modified in model. Model must recieve data from the view class as it
- is changed in the view.
- How do you implement this?
-
- : P.S. Your newsreader isn't configured properly; it's not giving a
- : valid return address (see above).
- It's not the reader (that I could fix) it's the mailer.
-